#include <iostream>

void astar_2011_r1a_1()
{
	int n = 0, m = 0;
	std::cin >> n >> m;

	int m2 = 0;
	for (int i = 0; i < m; i++)
	{
		int k = 0;
		std::cin >> k;
		if (k > 1)
			++m2;
	}

	std::cout << (long long)(n - m2) * m2 << std::endl;
}
